// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Router from 'vue-router'
import axios from 'axios'
import Mint from 'mint-ui';
import store from './js/store';






import 'mint-ui/lib/style.css'

//import 'mint-ui/lib/style.css';

import {post,fetch} from './js/http'
import urlAll from './js/kj_url'


//定义全局变量
Vue.prototype.$post=post;
Vue.prototype.$fetch=fetch;
Vue.prototype.$urlAll=urlAll;

// axios.defaults.withCredentials=true



import './assets/js/jquery.min'

import './js/ajax'
import './js/common'

import FastClick from 'fastclick'
FastClick.attach(document.body);


//首页轮播图
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)

Vue.use(urlAll);
Vue.use(Mint);

//var Drag = new DBSDrag('drag');


router.beforeEach((to, from, next) => {

  next();
  // var Drag = new DBSDrag('drag');
  dragToggle('close');

  if(from.path == '/pay/addPay' && to.path == '/pay/contactList'){
    $('.mobileSelect').empty();
  }


  // if (to.path == '/login') {
  //   sessionStorage.removeItem('user');
  // }
  // let user = JSON.parse(sessionStorage.getItem('user'));
  // if (!user && to.path != '/login') {
  //   next({ path: '/login' })
  // } else {
  //   next()
  // }
});



Vue.config.productionTip = false


// 过滤器
import * as myFilter from './js/myFilter'

Object.keys(myFilter).forEach(key => {
  Vue.filter(key, myFilter[key])
})




/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})



